package com.ogilvy.audi.webapp.util;

import com.ogilvy.audi.model.util.PageParameter;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by IntelliJ IDEA.
 * User: wutl
 * Date: 2010-7-23
 * Time: 16:15:16
 * To change this template use File | Settings | File Templates.
 */
public class PageConstants {
     private static final  Map paraMap=new HashMap();
     private static final  Map sortMap=new HashMap();
     private static final  Map dateMap=new HashMap();
     public static final  Map condition=new HashMap();

     public static final Integer DEFAULT_DISPLAYTAG_SIZE=20;
     public static final String DEFAULT_PARA_NAME ="para";
     public static final String DEFAULT_SORT_NAME ="sort";
     public static final String DEFAULT_DATE_NAME ="date";
    public static final String PAGE_NUMBER_NAME="pageNo";
    /**
     * 列表页 参数设置
     * 增删改查
     */
    public static final String SEARCH_URL_NAME="searchUrl";
    public static final String ADV_SEARCH_URL_NAME="adv_searchUrl";
    public static final String EDIT_URL_NAME="editUrl";
    public static final String ADD_URL_NAME="addUrl";
    public static final String DEL_URL_NAME="delUrl";

    public static final String TABLE_ID_NAME="tableId";
    public static final String SAVE_FORM_METHOD_NAME="formMethod";


     public static Map  initConditionMap(){

        condition.clear();
         List<PageParameter> pars=new ArrayList();
         List<PageParameter> dates=new ArrayList();
         List<PageParameter> sorts=new ArrayList();

         condition.put(PageConstants.DEFAULT_PARA_NAME,pars);
         condition.put(PageConstants.DEFAULT_DATE_NAME,dates);
         condition.put(PageConstants.DEFAULT_SORT_NAME,sorts);
         return condition;
    }


    public static Map getParaMap(){
        paraMap.clear();
        condition.put(DEFAULT_PARA_NAME,paraMap);
       return paraMap;
     }

     public static Map getSortMap(){
        sortMap.clear();
        condition.put(DEFAULT_SORT_NAME,sortMap);
       return sortMap;
     }
      public static Map getDateMap(){
        dateMap.clear();
        condition.put(DEFAULT_DATE_NAME,dateMap);
       return dateMap;
     }


    
}